#include "Game.h"

void Game::PrintDeck(const Deck* _deck)
{
	for(unsigned int x = 0; x < _deck->deck.size(); ++x)
	{
		PrintCard(_deck->deck[x]);
	}
}

int Game::HandValue(std::vector<Card*>& handref)
{
	int handVal = 0;

	for(unsigned int x = 0; x < handref.size(); ++x)
	{
		handVal += handref[x]->actualValue;
	}

	return handVal;
}

void Game::PrintHand(Player* player)
{
	for(unsigned int x = 0; x < player->Hand.size(); ++x)
	{
		PrintCard(player->Hand[x]);
	}
	std::cout << "Hand value: " << HandValue(player->Hand) << std::endl << std::endl;
}

void Game::PrintCard(const Card* card)
{
	std::cout << card->actualCard << " (" << card->actualValue << ")" << std::endl;
}

void Game::DealCard(Player* player, int cardAmount)
{
	for ( int x = 0; x < cardAmount; ++x )
	{
		player->Hand.push_back(gameDeck->deck.back());
		gameDeck->deck.pop_back();
	}
}